<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/10/5
  Time: 12:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script src="jquery-1.8.3.js"></script>
<html>
  <head>
    <title>电影信息列表</title>
    <style>
      #box{
        margin: 0 auto;
        width: 800px;
      }
      #box h1{
        text-align: center;
      }
      #table tr td{
        height: 20px;
        width: 120px;
      }
      #p a{
        text-decoration: none;
        padding-left: 20px;
      }
      #p span{
        padding-left: 20px;
      }
    </style>
  </head>
  <body>
  <div id="box">
    <h1>电影信息列表</h1>
    <button onclick="clii()">添加电影</button>
    <table id="table" border="1px solid black">
      <tr>
        <td>电影名称</td>
        <td>电影类型</td>
        <td>价格</td>
        <td>是否推荐</td>
        <td>上映时间</td>
        <td>下映时间</td>
        <td>投票数</td>
      </tr>
      <c:forEach var="list" items="${list}">
        <tr>
          <td>${list.name}</td>
          <td>${list.type}</td>
          <td>${list.price}</td>
          <td>${list.recommend==1?"推荐":"不推荐"}</td>
          <td>${list.startTime}</td>
          <td>${list.endTime}</td>
          <td>${list.votes}</td>
        </tr>
      </c:forEach>
    </table>
    <p id="p"><a href="list?page=1">首页</a> <a href="list?page=${page-1}">上一页</a> <a href="list?page=${page+1}">下一页</a> <a href="#">尾页</a>
    <span>第${page}页</span> <span>共${ys}页</span><span>总记录数${count}条</span>
    </p>
  </div>
  </body>
<script>
  $(function (){
    $("#table tr:odd").css("background","#ddf3e7")
    $("#table tr:even").css("background","#ddf3f2")
  })
  function clii(){
    location.href="add.jsp"
  }
</script>
</html>
